<template>
  <svg class="svg-icon" aria-hidden="true">
    <use :xlink:href="icon"></use>
  </svg>
</template>

<script>
import { computed } from 'vue'

export default {
  name: 'SvgIcon',
  props: {
    name: {
      type: String,
      required: true
    }
  },
  setup(props) {
    const icon = computed(() => {
      return `#icon-${props.name}`
    })
    return {
      icon
    }
  }
}
</script>
<style lang="scss" scoped>
.svg-icon {
  fill: currentColor;
  overflow: hidden;
}
</style>